package com.dragon.flow.service.flowable;

import com.dragon.flow.vo.processInstance.PlusEndVo;
import com.dragon.flow.vo.processInstance.PlusInstanceQueryParamsVo;
import com.dragon.flow.vo.processInstance.PlusProcessInstanceVo;
import com.dragon.flow.vo.processInstance.PlusStartProcessInstanceVo;
import com.dragon.tools.pager.PagerModel;
import com.dragon.tools.pager.Query;
import com.dragon.tools.vo.ReturnVo;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.flowable.engine.runtime.ProcessInstance;

import java.util.Map;

/**
 * @program: flow
 * @description: 流程实例service
 * @author: Bruce.Liu
 * @create: 2021-04-20 14:20
 **/
public interface FlowableProcessInstanceService {
    /**
     * 启动流程
     *
     * @param params 启动参数
     * @return 流程实例
     */
    ReturnVo<PlusProcessInstanceVo> startProcessInstanceByKey(PlusStartProcessInstanceVo params);

    /**
     * @param params   启动参数
     * @param personal 发起人
     * @return
     */
    Map<String, Object> getStartVariables(PlusStartProcessInstanceVo params, SysUser personal);

    /**
     * 查询我的流程列表
     *
     * @param paramsVo 查询参数
     * @return
     * @throws Exception
     */
    PagerModel<ProcessInstance> findMyProcessinstancesPagerModel(PlusInstanceQueryParamsVo paramsVo, Query query);

    /**
     * 终止流程
     *
     * @param endVo 基本参数
     * @return
     */
    ReturnVo<String> stopProcess(PlusEndVo endVo);
}
